package com.guiguli.StringBuilder;

import java.util.Scanner;

public class StringBuilderDemo3 {
    public static void main(String[] args) {
        //题目:要求判断回文
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        var str=sc.next();

        //2.反转
       var s =  new StringBuilder().append(str).reverse().toString();
        //3.比较顺便打印结果
       System.out.println( str.equals(s) ? "是回文串" : "不是回文串" );
    }
}
